﻿<%@ Page Title="My Events" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="My events.aspx.cs" Inherits="SoftwareEngineering_Project.Myevents" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <style type="text/css">
        .style2
        {
            color: #333333;
            text-align: center;
        }
        
        .style3
        {
            width: 100%;
            height: 249px;
        }
        .style4
        {
            color: #000000;
        }
        .style19
        {
            color: #000000;
            width: 313px;
        }
        .style9
        {
            color: #000000;
        }
        .style7
        {
            width: 320px;
            height: 16px;
        }
        .style18
        {
            height: 16px;
            width: 313px;
        }
        .style8
        {
            height: 16px;
        }
        .style14
        {
            width: 320px;
            height: 8px;
            color: #000000;
        }
        .style20
        {
            height: 8px;
            width: 150px;
            color: #000000;
        }
        .style22
        {
            height: 8px;
            width: 76px;
            color: #000000;
        }
        .style16
        {
            width: 320px;
            height: 6px;
        }
        .style21
        {
            height: 6px;
            width: 150px;
        }
        .style23
        {
            height: 6px;
            width: 76px;
        }
        .style24
        {
            height: 21px;
            color: #993300;
            font-weight: bold;
        }
        .style25
        {
            height: 7px;
        }
        .style27
        {
            height: 36px;
            text-align: left;
            color: #000000;
        }
        .style5
        {
            height: 36px;
            text-align: left;
        }
        .style28
        {
            text-align: left;
        }
        </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        My Events
    </h2>
    <p class="style2">
        <strong>&nbsp;Select an event to update the details:</strong><asp:SqlDataSource 
            ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:s-cheduleDBConnectionString %>" 
            OnLoad="SqlDataSource1_Selecting"
            SelectCommand="select ReservationID as 'ID',Res_Date as'Reservation Date', stime 'Start Time',etime as 'End Time',Reservation.Name as 'Event’s title',Organizer,room.Name as'Location' from reservation,Room WHERE reservation.Room_ID = Room.Room_ID AND Username = 'admin'">
        </asp:SqlDataSource>
        <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </ajaxToolkit:ToolkitScriptManager>
    </p>
    <p align="center">
        <asp:GridView ID="MyEvents" runat="server" CellPadding="4" ForeColor="#333333"
            onselectedindexchanged="MyEvents_SelectedIndexChanged" Width="866px"
            AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="SqlDataSource1">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <EmptyDataTemplate>No Events</EmptyDataTemplate>
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" />
                <asp:BoundField DataField="Reservation Date" HeaderText="Reservation Date" 
                    SortExpression="Reservation Date" />
                <asp:BoundField DataField="Start Time" HeaderText="Start Time" 
                    SortExpression="Start Time" />
                <asp:BoundField DataField="End Time" HeaderText="End Time" 
                    SortExpression="End Time" />
                <asp:BoundField DataField="Event’s title" HeaderText="Event’s title" 
                    SortExpression="Event’s title" />
                <asp:BoundField DataField="Organizer" HeaderText="Organizer" 
                    SortExpression="Organizer" />
                <asp:BoundField DataField="Location" HeaderText="Location" 
                    SortExpression="Location" />
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>
    </p>
    <asp:Panel ID="Panel1" runat="server" Visible="False" Height="247px">
        <table class="style3" frame="box">
            <tr>
                <td class="style4" colspan="5">
                    <strong>Please specify the type of the conference:<br /></strong>
                    <asp:DropDownList ID="ConferenceType" runat="server" AutoPostBack="True">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style4">
                    Title of the meeting:</td>
                <td class="style19" colspan="3">
                    Organizer:</td>
                <td class="style9">
                    Location:</td>
            </tr>
            <tr>
                <td class="style7">
                    <asp:TextBox ID="title" runat="server" Width="271px" CssClass="bold"></asp:TextBox>
                </td>
                <td class="style18" colspan="3">
                    <asp:TextBox ID="Organizer" runat="server" 
                        Width="227px" CssClass="bold"></asp:TextBox>
                </td>
                <td class="style8">
                    <asp:DropDownList ID="Location" runat="server" CssClass="bold">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style14">
                    Date:</td>
                <td class="style20">
                    Start time:</td>
                <td class="style22" colspan="2">
                    End time:</span></td>
            </tr>
            <tr>
                <td class="style16">
                    <asp:TextBox ID="date" runat="server"></asp:TextBox>
                    <ajaxToolkit:CalendarExtender ID="date_CalendarExtender" runat="server" 
                        Enabled="True" TargetControlID="date">
                    </ajaxToolkit:CalendarExtender>
                    <ajaxToolkit:MaskedEditExtender ID="date_MaskedEditExtender" runat="server" 
                        Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                        CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                        CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                        Mask="99/99/9999" MaskType="Date" TargetControlID="date">
                    </ajaxToolkit:MaskedEditExtender>
                </td>
                <td class="style21">
                    <asp:TextBox ID="starttime" runat="server" CssClass="bold"></asp:TextBox>
                </td>
                <td class="style23" colspan="2">
                    <asp:TextBox ID="endtime" runat="server" CssClass="bold" 
                    ontextchanged="endtime_TextChanged"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style24" colspan="5">
                    <strong>More details:</strong></td>
            </tr>
            <tr class="style9">
                <td class="style25">
                    Record this conference (Audio)</td>
                <td class="style25" colspan="2">
                    Record this conference (Video)</td>
                <td class="style25" colspan="2">
                    Do you need presentation?</td>
            </tr>
            <tr>
                <td class="style27">
                    <i>
                    <asp:RadioButton ID="AudioYes" runat="server" GroupName="Gaudio" Text="Yes" />
                    <asp:RadioButton ID="AudioNo" runat="server" Checked="True" GroupName="Gaudio" 
                        Text="No" />
                    </i>
                </td>
                <td class="style5" colspan="2">
                    <i>
                    <asp:RadioButton ID="VideoYes" runat="server" CssClass="style9" 
                        GroupName="Gvideo" Text="Yes" />
                    </i><span class="style9"><i>
                    <asp:RadioButton ID="VideoNo" runat="server" Checked="True" GroupName="Gvideo" 
                        Text="No" />
                    </i>
                </td>
                <td class="style5" colspan="2">
                    <i></span>
                    <asp:RadioButton ID="PresentationYes" runat="server" GroupName="Gpresentation" 
                        Text="Yes" />
                    <asp:RadioButton ID="PresentationNO" runat="server" Checked="True" 
                        GroupName="Gpresentation" Text="No" />
                    </i></span>
                </td>
            </tr>
            <tr>
                <td class="style5" colspan="5">
                    <asp:Button ID="Update" runat="server" Font-Bold="True" ForeColor="#006600" 
                        onclick="Update_Click" Text="Update" Width="115px" />
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="Delete" runat="server" Font-Bold="True" ForeColor="Maroon" 
                        onclick="Delete_Click" Text="Delete" Width="99px" />
                    &nbsp;
                    <asp:Label ID="Errormessage" runat="server" Font-Bold="True" 
                        ForeColor="#CC3300" Text="Label" Visible="False"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="style28" colspan="5">
                </td>
            </tr>
        </table>
    </asp:Panel>
        </asp:Content>
